package com.leyou.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.order.pojo.Order;
import com.leyou.order.pojo.OrderDetail;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 *
 */
public interface OrderDetailMapper extends BaseMapper<OrderDetail> {

    @Select("SELECT sku.id,sku.stock FROM tb_order_detail tod JOIN tb_sku sku ON tod.sku_id = sku.id AND tod.order_id = #{orderId}")
    Map<Long,Integer> findStockAndSkuId(Long orderId);
}
